﻿<!DOCTYPE html>

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <title></title>
    <script>
        //alert("准备就绪");
        window.external.ShowMsgForJs("准备就绪");

        function ShowMsgForCSharp(str) {
            var msg = "收到消息：" + str;

            //1、调用C#方法;
            window.external.ShowMsgForJs(msg);
            //2、改变网页内容;
            document.getElementById("info").innerHTML += msg + "<br/>";
            //3、弹窗;
            alert(msg);
        }
    </script>
</head>
<body>
    <div>通过 WebBrowser 让 JS 与 C# 代码交互 测试页</div>
    <div id="info"></div>
</body>
</html>